# !/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Time        : 2020/11/19 17:53
@Author      : Albert Darren
@Contact     : 2563491540@qq.com
@File        : lagrange_preliminaries.py
@Version     : Version 1.0.0
@Description : TODO
@Created By  : PyCharm
"""
from scipy.interpolate import lagrange
import numpy as np

x = np.arange(0.32, 0.38, 0.02)  # 数据点横坐标集合
w = np.array([0.314567, 0.333487, 0.352274]) # 数据点纵坐标集合
_ploy1d = lagrange(x[:2], w[:2])
_ploy2d = lagrange(x, w)
print(_ploy2d)